package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.heart.mapper.AssetsChangeMapper;
import com.ly.heart.service.IAssetsChangeService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.AssetsChangeEntity;

import javax.annotation.Resource;

/**
 * 资产卡片变更Service业务层处理
 *
 * @author cxl
 * @date 2024-09-29
 */
@Service
public class AssetsChangeServiceImpl extends ServiceImpl<AssetsChangeMapper,AssetsChangeEntity> implements IAssetsChangeService {

    @Resource
    private AssetsChangeMapper assetsChangeMapper;

    /**
     * 查询资产卡片变更
     *
     * @param id 资产卡片变更ID
     * @return 资产卡片变更
     */
    @Override
    public AssetsChangeEntity selectAssetsChangeEntityById(String id)
    {
        return assetsChangeMapper.selectAssetsChangeEntityById(id);
    }

    /**
     * 查询资产卡片变更列表
     *
     * @param assetsChangeEntity 资产卡片变更
     * @return 资产卡片变更
     */
    @Override
    public List<AssetsChangeEntity> selectAssetsChangeEntityList(AssetsChangeEntity assetsChangeEntity)
    {
        return assetsChangeMapper.selectAssetsChangeEntityList(assetsChangeEntity);
    }

    /**
     * 新增资产卡片变更
     *
     * @param assetsChangeEntity 资产卡片变更
     * @return 结果
     */
    @Override
    public int insertAssetsChangeEntity(AssetsChangeEntity assetsChangeEntity)
    {
        assetsChangeEntity.setCreateTime(DateUtils.getNowDate());
        return assetsChangeMapper.insertAssetsChangeEntity(assetsChangeEntity);
    }

    /**
     * 修改资产卡片变更
     *
     * @param assetsChangeEntity 资产卡片变更
     * @return 结果
     */
    @Override
    public int updateAssetsChangeEntity(AssetsChangeEntity assetsChangeEntity)
    {
        assetsChangeEntity.setUpdateTime(DateUtils.getNowDate());
        return assetsChangeMapper.updateAssetsChangeEntity(assetsChangeEntity);
    }

    /**
     * 批量删除资产卡片变更
     *
     * @param ids 需要删除的资产卡片变更ID
     * @return 结果
     */
    @Override
    public int deleteAssetsChangeEntityByIds(String[] ids)
    {
        return assetsChangeMapper.deleteAssetsChangeEntityByIds(ids);
    }

    /**
     * 删除资产卡片变更信息
     *
     * @param id 资产卡片变更ID
     * @return 结果
     */
    @Override
    public int deleteAssetsChangeEntityById(String id)
    {
        return assetsChangeMapper.deleteAssetsChangeEntityById(id);
    }

}
